package com.wjx.reservation_service.controller;

import com.wjx.reservation_service.model.Appointment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class TestController {
    @GetMapping("/api/content")
    public List<ContentResponse> getContent() {
        List<ContentResponse> contentResponses = new ArrayList<>();
        // 在这里处理逻辑，从数据库或其他数据源获取内容数据
        String content = "This is the content from the backend!";
        contentResponses.add(new ContentResponse(content));
        contentResponses.add(new ContentResponse(content));
        contentResponses.add(new ContentResponse(content));
        return contentResponses;
    }
//    @PostMapping("/addAppointment")
//    public  void addAppointment(Appointment appointment) {
//                System.out.println(appointment.getAppointmentTime());
//                System.out.println(appointment.getAppointmentLocation());
//                System.out.println(appointment.getPhone());
//                System.out.println(appointment.getServiceId());
//                System.out.println(appointment.getUserId());
//    }
    private static class ContentResponse {
        private String content;

        public ContentResponse(String content) {
            this.content = content;
        }

        public String getContent() {
            return content;
        }
    }
}
